package cc.example;

import reactor.core.publisher.Flux;

public class FluxError {
    public static void main(String[] args) {
        /*
         * 1.doOnNext：每个数据（流的数据）到达的时候触发
         * 2. doOnEach：每个元素（流的数据和信号）到达的时候触发
         */
        Flux.range(1,7)
                .map(integer -> 10/0)
                .doOnError(throwable -> {
                    System.out.println(throwable);
                })
                .subscribe(integer -> {
                    System.out.println(integer);
                });

        NullPointerException nullPointerException = new NullPointerException();


        Class<? extends NullPointerException> aClass = nullPointerException.getClass();

        System.out.println(aClass == NullPointerException.class);

    }
}
